package com.geek.controller;

import com.geek.bean.BaseRespVo;
import com.geek.bean.data.ResponseCatalogIndexData;
import com.geek.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author wbw
 * @data 2024/06/17 14:59
 **/
@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {
    @Autowired
    CategoryService categoryService;

    @GetMapping("index")
    public BaseRespVo index(){
        ResponseCatalogIndexData data = categoryService.index();
        return BaseRespVo.ok(data);
    }

    @GetMapping("current")
    public BaseRespVo current(Integer id){
        Map<String ,Object> data = categoryService.current(id);
        return BaseRespVo.ok(data);
    }
}
